

#如果没有赋值，就给这个值
PREFIX ?= ../install 
#PRJNAME = server_main
PRJNAME = client_main
LIBNAME = sqlitet3
LOGNAME = logger

CFLAGS  += -I ../include#-I 头文件路径 -L 动态库路径
LDFLAGS += -L ../src -L /home/zkf/install/lib -lsqlite3 -lsrc
RUNFLAGS += -i 127.0.0.1 -p 4444 -s ZKF0001 -t 10

all: 
	gcc  ${PRJNAME}.c -o ${PRJNAME} ${CFLAGS} ${LDFLAGS}



static_lib:
	gcc -c sqlite3.c
	ar -rcs lib${LIBNAME}.a sqlite3.o

shared_lib:
	gcc -shared -fPIC sqlite3.c -o lib${LIBNAME}.so

LD_export:
	export LD_LIBRARY_PATH=$ LD_LIBRARY_PATH:/home/zkf/project_socket/src/:/home/zkf/install/lib
#/home/zkf/project/_socket/src/    PATH of .c
#/home/zkf/install/lib             PATH of libsqlite3 

run:
	./${PRJNAME} ${RUNFLAGS}


clean:
	rm *.db
	rm ${PRJNAME}


#创建include存放头文件，创建lib存放静态库和动态库
install:
	cp lib*.a lib*.so ${PREFIX}/lib
	cp *.h ${PREFIX}/include

